﻿using System;
using System.ComponentModel;
using System.Windows;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for EditEventWindow.xaml
    /// </summary>
    public partial class TPVK03 
    { 
       
        #region ==JOBTYPE===========
        public static readonly DependencyProperty JOBTYPEProperty = DependencyProperty.Register("JOBTYPE",
            typeof(string), typeof(TPVK03),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnJOBTYPEChanged));
        public string JOBTYPE
        {
            get
            {
                return (string)GetValue(JOBTYPEProperty);
            }
            set
            {
                SetValue(JOBTYPEProperty, value);
            }
        }
        private static void OnJOBTYPEChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as TPVK03;
            if (src != null)
            {
                  src.JOBTYPE = (string)e.NewValue;
            }
        }
        #endregion 
         public TPVK03()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VVKPOS();
            this.DataContext = MV;
            MESSAGES += "VKKNEW;VVRELOAD;VVTCHG;VKPCHK;WDCHG;"; 
            InitializeComponent();
            DTSTART = MV.date;
            DTEND = MV.date;
           
        }
      
        public override void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            base.Window_Loaded(sender, e);
           
        }
      
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
           
        }

        public override void QueryCommand(object sender, System.Windows.RoutedEventArgs e)
        {
            TMV.YGRVKP();
            base.QueryCommand(sender, e);
        }
        public  void QueryTDPlanCommand(object sender, System.Windows.RoutedEventArgs e)
        {
            dwData =TMV.MUX.TBMain.NewRow(); 
            dwData["ABAVKAUFTYP"] = " MU.ABAVKAUFTYP='K' AND MU.ABANEUDAT>=" + DTSTART+ " AND MU.ABANEUDAT<=" + DTEND; 
            SResult =TMV.QVKP111(dwData);
            MergeData(SResult, false);
            base.QueryCommand(sender, e);
        } 
    }
}
